from celery.schedules import crontab

beat_schedule = {
    'print-time-every-5-seconds': {
        'task': 'tasks.print_time',
        'schedule': 5.0,  # 每5秒执行一次
    },
    'run-task1-every-day-15-30': {
        'task': 'tasks.task1',
        'schedule': crontab(hour=15, minute=30),
    },
    'run-task2-every-day-16-00': {
        'task': 'tasks.task2',
        'schedule': crontab(hour=16, minute=0),
    },
    # A股开盘时间段每分钟执行一次
    'run-stock-market-task-morning-1': {
        'task': 'tasks.stock_market_task',
        'schedule': crontab(minute='15-59', hour=9),  # 09:15-09:59
    },
    'run-stock-market-task-morning-2': {
        'task': 'tasks.stock_market_task',
        'schedule': crontab(minute='*', hour=10),     # 10:00-10:59
    },
    'run-stock-market-task-morning-3': {
        'task': 'tasks.stock_market_task',
        'schedule': crontab(minute='0-30', hour=11),  # 11:00-11:30
    },
    'run-stock-market-task-afternoon-1': {
        'task': 'tasks.stock_market_task',
        'schedule': crontab(minute='*', hour=13),     # 13:00-13:59
    },
    'run-stock-market-task-afternoon-2': {
        'task': 'tasks.stock_market_task',
        'schedule': crontab(minute='*', hour=14),     # 14:00-14:59
    },
    'run-stock-market-task-afternoon-3': {
        'task': 'tasks.stock_market_task',
        'schedule': crontab(minute='0', hour=15),     # 15:00
    },
    # ... 继续添加更多任务
} 